#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<fcntl.h>
#include<sys/stat.h>

int main(){
  close(1);
  int fd=open("log.txt",O_CREAT|O_WRONLY|O_TRUNC,0666);

  printf("fd :%d\n",fd);
  fprintf(stdout,"fprintf fd:%d\n",fd);
  //fflush(stdout);
  close(fd);
  return 0;
}
